{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "project_info = pd.read_csv('all_classes.csv')\n",
    "meta_info = pd.read_csv('dynamosa_benchmark.csv')\n",
    "def fulfil(x):\n",
    "    meta = meta_info[(meta_info['class']==x['class'])].reset_index(drop=True).loc[0]\n",
    "    x['branch']=meta['n.branch']\n",
    "    x['statement']=meta['n.statement']\n",
    "    x['mutant']=meta['n.mutant']\n",
    "    return x\n",
    "project_info=project_info.apply(lambda x: fulfil(x), axis=1)\n",
    "project_info=project_info[project_info['branch']>30]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>project</th>\n",
       "      <th>class</th>\n",
       "      <th>branch</th>\n",
       "      <th>statement</th>\n",
       "      <th>mutant</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>104</th>\n",
       "      <td>85_shop</td>\n",
       "      <td>umd.cs.shop.JSPredicateForm</td>\n",
       "      <td>87</td>\n",
       "      <td>706</td>\n",
       "      <td>330</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>156</th>\n",
       "      <td>e6_commons-math</td>\n",
       "      <td>org.apache.commons.math3.util.Multidimensional...</td>\n",
       "      <td>41</td>\n",
       "      <td>261</td>\n",
       "      <td>431</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86</th>\n",
       "      <td>77_io-project</td>\n",
       "      <td>ioproject.server.network.ClientGroup</td>\n",
       "      <td>66</td>\n",
       "      <td>282</td>\n",
       "      <td>96</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>51</th>\n",
       "      <td>47_dvd-homevideo</td>\n",
       "      <td>Convert</td>\n",
       "      <td>52</td>\n",
       "      <td>1386</td>\n",
       "      <td>98</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>192</th>\n",
       "      <td>e12_twitter4j</td>\n",
       "      <td>twitter4j.Paging</td>\n",
       "      <td>54</td>\n",
       "      <td>540</td>\n",
       "      <td>396</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>182</th>\n",
       "      <td>e11_trove</td>\n",
       "      <td>gnu.trove.decorator.TDoubleShortMapDecorator</td>\n",
       "      <td>77</td>\n",
       "      <td>232</td>\n",
       "      <td>109</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>36_schemaspy</td>\n",
       "      <td>net.sourceforge.schemaspy.model.Table</td>\n",
       "      <td>380</td>\n",
       "      <td>2241</td>\n",
       "      <td>602</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>112</th>\n",
       "      <td>88_jopenchart</td>\n",
       "      <td>de.progra.charting.CoordSystemUtilities</td>\n",
       "      <td>92</td>\n",
       "      <td>1139</td>\n",
       "      <td>529</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>141</th>\n",
       "      <td>e5_commons-lang</td>\n",
       "      <td>org.apache.commons.lang3.text.translate.Numeri...</td>\n",
       "      <td>48</td>\n",
       "      <td>216</td>\n",
       "      <td>240</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>157</th>\n",
       "      <td>e6_commons-math</td>\n",
       "      <td>org.apache.commons.math3.optimization.general....</td>\n",
       "      <td>207</td>\n",
       "      <td>2162</td>\n",
       "      <td>951</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>100 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "              project                                              class  \\\n",
       "104           85_shop                        umd.cs.shop.JSPredicateForm   \n",
       "156   e6_commons-math  org.apache.commons.math3.util.Multidimensional...   \n",
       "86      77_io-project               ioproject.server.network.ClientGroup   \n",
       "51   47_dvd-homevideo                                            Convert   \n",
       "192     e12_twitter4j                                   twitter4j.Paging   \n",
       "..                ...                                                ...   \n",
       "182         e11_trove       gnu.trove.decorator.TDoubleShortMapDecorator   \n",
       "38       36_schemaspy              net.sourceforge.schemaspy.model.Table   \n",
       "112     88_jopenchart            de.progra.charting.CoordSystemUtilities   \n",
       "141   e5_commons-lang  org.apache.commons.lang3.text.translate.Numeri...   \n",
       "157   e6_commons-math  org.apache.commons.math3.optimization.general....   \n",
       "\n",
       "     branch  statement  mutant  \n",
       "104      87        706     330  \n",
       "156      41        261     431  \n",
       "86       66        282      96  \n",
       "51       52       1386      98  \n",
       "192      54        540     396  \n",
       "..      ...        ...     ...  \n",
       "182      77        232     109  \n",
       "38      380       2241     602  \n",
       "112      92       1139     529  \n",
       "141      48        216     240  \n",
       "157     207       2162     951  \n",
       "\n",
       "[100 rows x 5 columns]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "project_info.sample(100)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
